﻿#ifndef MUTEX_H
#define MUTEX_H

#include <stdint.h>
#include <Windows.h>

namespace RemoteObj
{
#define REMOTEOBJ_MUTEX_WAIT_INFINITE INFINITE
#define remote_obj_mutex_t HANDLE

class Mutex
{
public:
    Mutex();
    virtual ~Mutex();
    int32_t lock(uint32_t millisecond = REMOTEOBJ_MUTEX_WAIT_INFINITE);
    int32_t unlock();
protected:
    Mutex(const Mutex&);
    Mutex& operator=(const Mutex&);
private:
    remote_obj_mutex_t _mutex;
};
}

#endif // MUTEX_H
